/**
 * Created with CLion.
 * Description: 
 * User: loong
 * Date: 2024/6/12
 * Time: 11:22
 */

#include "Card.h"

namespace Upgrade {
    QMap<CardRank, int> Card::score_map_ = {{CardRank::Five, 5}, {CardRank::Ten, 10}, {CardRank::King, 10}};

    Card::Card()
        : rank(CardRank::Unkonw)
        , color(Qt::white)
        , suit(CardSuit::Unkonw)
        , trump(false)
        , score(score_map_.value(rank, 0))
    {
    }

    Card::Card(CardRank _rank, QColor _color, CardSuit _suit, bool _trump /*= false*/)
        : rank(_rank)
        , color(_color)
        , suit(_suit)
        , trump(_trump)
        , score(score_map_.value(rank, 0)) {};

    void Card::Print() const
    {
        qDebug() << "Rank: " << Rank2String(rank) << "\t{Suit: " << static_cast<int>(suit) << "\tColor: " << color.name() << "}";
    }
}// namespace Upgrade